
window.onload = function () {
    var aLi = document.querySelectorAll('#outer li');

    var index = 0;
    setInterval(autoPlay, 1500);

    var speed = 1;
    function autoPlay() {
        for (var i = 0; i < aLi.length; i++) {
            aLi[i].className = '';
        }
        index = index + speed;
        aLi[index].className = 'active';
        if (index == 0 || index == aLi.length - 1) {
            speed = -speed;
        }
    }

}
